module.exports = (req, res, next) => {
  if (req.method === "POST" && req.path === "/login") {
    if (req.body.userName === "admin" && req.body.password === "123456") {
      return res.status(200).json({
        code: 0,
        data: {
          userInfo: {
            avatar:
              "/uploads/1/CHP_1634630176570_16f194d7b8580d2950c33ab2c9e549d2.jpg",
            createdAt: "2021-07-08 14:52:13",
            createdBy: "admin",
            department: {
              createdAt: "2021-07-08 14:52:13",
              createdBy: "admin",
              deptId: 1,
              deptName: "总部",
              isDelete: "0",
              orderNum: 1,
              parentId: 0,
              status: "1",
              updatedAt: null,
              updatedBy: null,
            },
            deptId: 1,
            email: "789sd@qq.com",
            id: 1,
            isDelete: "0",
            mobile: "13711031522",
            nickName: "admin123",
            password:
              "$2a$10$h9F9wNK9FBW3LQpjH/mGHurD88WNfYUVYwSRe0wnoYT8tJVAjK0Sm",
            remark: "",
            sex: "1",
            status: "1",
            updatedAt: "2021-07-09 15:14:59",
            updatedBy: "admin",
            userName: "admin",
          },
        },
        message: "成功",
      });
    } else {
      return res.status(400).json({
        code: 400,
        data: null,
        message: "用户名或密码错误",
      });
    }
  }
  next();
};
